package com.supergdtop.www.run.tools;

import android.content.Context;
import android.view.Gravity;
import android.widget.TextView;
import android.widget.Toast;

import com.asum.xuidesign.utils.view.TextViewTools;
import com.supergdtop.www.run.R;
import com.supergdtop.www.run.finaldata.FontSize;
import com.supergdtop.www.run.finaldata.Global;
import com.supergdtop.www.run.finaldata.XColor;


/**
 * Toast相关工具
 * Created by Asum on 2016/5/16 0016.
 */
public class ToastTools {
    public static void show(Context context, String text) {
        int padding = Global.padding(context);

        Toast toast = new Toast(context);
        TextView tipTextView = new TextView(context);
        toast.setView(tipTextView);
        tipTextView.setText(text);
        //tipTextView.setBackgroundResource(R.drawable.shape_rect_gray_gray);
        tipTextView.setPadding(padding, padding, padding, padding);
        new TextViewTools(tipTextView).defaulPadding(false).grav(Gravity.CENTER).textColor(XColor.WHITE).sizePx(FontSize.s18(context));

        toast.setDuration(Toast.LENGTH_SHORT);
        toast.show();
    }
}
